/**
 * 
 */
package org.crud4j.core.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Annotated fields are evaluated against the given regexp before save.
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface CrudValidation {

	/**
	 * @return the client side validation expression
	 */
	String regexp();

	/**
	 * @return the message to show if the validation doesn't succed
	 */
	String message() default "invalid entry";

}
